﻿using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Xml;
using System.Xml.Linq;

namespace LoadController
{
    public partial class _Default : Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            //String TransactionXML = "<?xml version=\"1.0\" encoding=\"utf-8\"?><soap:Envelope xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\"><soap:Body><GetQuoteResponse xmlns=\"http://www.webserviceX.NET/\"><GetQuoteResult>&lt;StockQuotes&gt;&lt;Stock&gt;&lt;Symbol&gt;AAPL&lt;/Symbol&gt;&lt;Last&gt;440.99&lt;/Last&gt;&lt;Date&gt;7/26/2013&lt;/Date&gt;&lt;Time&gt;4:00pm&lt;/Time&gt;&lt;Change&gt;+2.49&lt;/Change&gt;&lt;Open&gt;435.30&lt;/Open&gt;&lt;High&gt;441.04&lt;/High&gt;&lt;Low&gt;434.34&lt;/Low&gt;&lt;Volume&gt;7152679&lt;/Volume&gt;&lt;MktCap&gt;413.9B&lt;/MktCap&gt;&lt;PreviousClose&gt;438.50&lt;/PreviousClose&gt;&lt;PercentageChange&gt;+0.57%&lt;/PercentageChange&gt;&lt;AnnRange&gt;385.10 - 705.07&lt;/AnnRange&gt;&lt;Earns&gt;41.896&lt;/Earns&gt;&lt;P-E&gt;10.47&lt;/P-E&gt;&lt;Name&gt;Apple Inc.&lt;/Name&gt;&lt;/Stock&gt;&lt;/StockQuotes&gt;</GetQuoteResult></GetQuoteResponse></soap:Body></soap:Envelope>";

            //XmlDocument xmlDoc = new XmlDocument();
            //System.IO.Stream xmlStream;
            //System.Xml.Xsl.XslCompiledTransform xsl = new System.Xml.Xsl.XslCompiledTransform();
            //ASCIIEncoding enc = new ASCIIEncoding();
            //System.IO.StringWriter writer = new System.IO.StringWriter();

            //// Get Xsl
            //xsl.Load(HttpContext.Current.Server.MapPath("/Content/defaultss.xslt"));

            //// Remove the utf encoding as it causes problems with the XPathDocument
            //TransactionXML = TransactionXML.Replace("utf-32", "");
            //TransactionXML = TransactionXML.Replace("utf-16", "");
            //TransactionXML = TransactionXML.Replace("utf-8", "");
            //xmlDoc.LoadXml(TransactionXML);

            //// Get the bytes
            //xmlStream = new System.IO.MemoryStream(enc.GetBytes(xmlDoc.OuterXml), true);

            //// Load Xpath document
            //System.Xml.XPath.XPathDocument xp = new System.Xml.XPath.XPathDocument(xmlStream);

            //// Perform Transform
            //xsl.Transform(xp, null, writer);
            //MessageLiteral.Text = writer.ToString();  
        }

    }
}